package common;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import pojo.EssayAndUser;
import pojo.MessageUserEssay;
import pojo.User;

    /**
    　　* @param
    　　* @return
    　　* @author：千夜
    　　* @date 2019/5/7 20:35
     　 * @description: TODO：返回数据表格需要的格式数据
    　　*/
public class TableReturn {

	public Map<String, Object> returnData(List<MessageUserEssay> list){
		if(list!=null){
			Map<String, Object> map=new HashMap<String,Object>();
			map.put("code", 0);
			map.put("msg", "");
			map.put( "count", list.size());
			map.put("data", list);
			return map;
		}else
			return  null;
	}
	
	public Map<String, Object> returnEssayData(Integer TotalCount,List<EssayAndUser> list){
		if(list!=null){
			Map<String, Object> map=new HashMap<String,Object>();
			map.put("code", 0);
			map.put("msg", "");
			map.put( "count", TotalCount);
			map.put("data", list);
			return map;
		}else
			return  null;
	}
	
	public Map<String, Object> returnUserData(Integer TotalCount,List<User> list){
		if(list!=null){
			Map<String, Object> map=new HashMap<String,Object>();
			map.put("code", 0);
			map.put("msg", "");
			map.put( "count",TotalCount);
			map.put("data", list);
			return map;
		}else
			return  null;
	}
}
